package com.xuecheng.manage_cms.service;

import com.xuecheng.framework.domain.cms.CmsConfig;
import com.xuecheng.framework.model.response.CommonCode;
import com.xuecheng.framework.model.response.ResponseResult;
import com.xuecheng.manage_cms.dao.CmsConfigRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * cms配置管理
 */
@Service
public class CmsConfigService {

    @Autowired
    private CmsConfigRepository cmsConfigRepository;
    /**
     * 根据id查询页面
     * @param id
     * @return
     */
    public ResponseResult<CmsConfig> findById(String id){
        Optional<CmsConfig> optional = cmsConfigRepository.findById(id);
        return new ResponseResult(CommonCode.SUCCESS,optional.get());
    }

}
